import Vue from 'vue'
import axios from 'axios'

//引入axios拦截器配置
import Interception from './Interception'

// let base = "http://localhost:8080/weharvest"; //本地库
let base = "http://sanly.mynatapp.cc/weharvest/"

let Api = {
    host: base,
    //用户登录
    login: (params) => {
        return axios.post(base + "edu/login",params)
    },
    detail: (params) =>{
        return axios.post(base + 'edu/detail',params);
    },
    user:{
        find: (params) =>{
             return axios.post(base + 'admin/backstage/user/find',params);
        },
        Disable: (params) =>{
            return axios.post(base + 'admin/backstage/user/disable',params);
        }, 
        delete: (params) =>{
            return axios.post(base + 'admin/backstage/user/delete',params);
        },
        add: (params) =>{
            return axios.post(base + 'admin/backstage/user/add',params);
        }, 
        modify: (params) =>{
            return axios.post(base + 'admin/backstage/user/modify',params);
        }
    },
    role:{
        // 查看结构
        findStructure: (params) => {
            return axios.post(base + 'admin/backstage/role/structure/find',params);
        },
        //角色列表
        find: (params) => {
            return axios.post(base + 'admin/backstage/role/find',params);
        },  
        // 角色授权列表
        findAuthorization: (params) => {
            return axios.post(base + 'admin/backstage/role/authorization/find',params);
        },
        // 角色授权列表
        findAuthorizationOne: (params) => {
            return axios.post(base + 'admin/backstage/role/authorization/find/one',params);
        },
        // 发起授权
        addAuthorization: (params) => {
            return axios.post(base + 'admin/backstage/role/authorization/add',params);
        },
        modify: (params) => {
            return axios.post(base + 'admin/backstage/role/modify', params)
        },
        delete: (params) =>{
            return axios.post(base + 'admin/backstage/role/delete', params)
        },
        add : (params) =>{
            return axios.post(base + 'admin/backstage/role/add',params)
        }
    },
    wechat:{
        // 授权
        authorize: (params) =>{
            return axios.post(base + 'wechat/jssdk', params);
        },
        // 上传录音
        uploadRecord: (params) => {
            return axios.post(base + 'wechat/record/upload', params)
        }
    }
}
export default Api
